package com.yumeng.webapp.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wxd
 * @date 2024/11/21 16:25
 */
@Slf4j
@RestController
@RequestMapping("/perm")
public class PermController {

    @PreAuthorize("hasUser('ym')")
    @GetMapping("/save.do")
    String save() {
        return "save";
    }

    @GetMapping("/del.do")
    String del() {
        return "del";
    }

    @PreAuthorize("hasAuthority('update:user')")
    @GetMapping("/update.do")
    String update() {
        return "update";
    }


    @PreAuthorize("hasRole('bb2')")
    @GetMapping("/list.do")
    String list() {
        return "list";
    }

}
